﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace NetDiskPRJ.BLL
{
    public class SysParam
    {
        public SysParam()
        {
 
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<NetDiskPRJ.Model.SysParam> GetModelList(string strWhere)
        {
            NetDiskPRJ.DAL.SysParam dal = new NetDiskPRJ.DAL.SysParam();
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得系统印花税相关数据列表
        /// <creator>wangl</creator>
        /// <date>2013-02-13</date>
        /// </summary>
        public List<NetDiskPRJ.Model.SysParam> GetStampTaxList()
        {
            NetDiskPRJ.DAL.SysParam sysParamDAL = new NetDiskPRJ.DAL.SysParam();
            DataSet ds = sysParamDAL.GetStampTaxList();
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<NetDiskPRJ.Model.SysParam> DataTableToList(DataTable dt)
        {
            NetDiskPRJ.DAL.SysParam dal = new NetDiskPRJ.DAL.SysParam();
            List<NetDiskPRJ.Model.SysParam> modelList = new List<NetDiskPRJ.Model.SysParam>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                NetDiskPRJ.Model.SysParam model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }
    }
}
